﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace ProjectThuCung.Models
{
    public class XuatXu
    {
        [Key]
        public int XuatXuID { get; set; }

        [Required]
        [MaxLength(56)]
        [Display(Name = "Xuất xứ")]
        public String TenXuatXu { get; set; }

        [Required]
        [MaxLength(128)]
        [Display(Name = "Địa chỉ chi tiết")]
        public String DiaChi { get; set; }

        public static List<XuatXu> xuatxu = XuatXu.load_xx();

        static List<XuatXu> load_xx()
        {
            ThuCungDB db = new ThuCungDB();
            var data = db.XuatXus.ToList();
            if (data.Count > 0)
            {
                return data;
            }
            return null;
        }
    }
}